/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.innovision.vo;

import cl.innovision.helper.utils.Types;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Properties;

/**
 *
 * @author PATO
 */
public class Procedures {
     private static Procedures singleton = null;
  
    LinkedList<Procedure> precedures =new LinkedList<Procedure>();
    public static Procedures getInstance() {
        if (singleton == null) {
            singleton = new Procedures();
        }
        return singleton;
    }
    
    public void addPrecedures(Procedure precedures) {
        this.precedures.add(precedures);
    }
     public void setPrecedure(int index,Procedure precedures) {
        this.precedures.set(index,precedures);
    }
     
      public Procedure getPrecedure(int index) {
        return precedures.get(index);
    }
     
    public LinkedList<Procedure> getPrecedures() {
        return precedures;
    }

    public void setPrecedures(LinkedList<Procedure> precedures) {
        this.precedures = precedures;
    }
    
     public void updateProcedure(Procedure precedure) {
         for (int i=0;i< precedures.size();i++ )
         {
             if(precedures.get(i).getName().equals(precedure.getName()))
            {
                    precedures.set(i, precedure);
            }
         }
    }
     public Procedure getProcedureByName(String nombre) {
         for (int i=0;i< precedures.size();i++ )
         {
             if(precedures.get(i).getName().equals(nombre))
            {
                    return precedures.get(i);
            }
         }
         return null;
    }
      public  void removeAll() {
          while (!precedures.isEmpty())
             precedures.removeFirst();
        
    }
    
}
